home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / perl5 / File::Spec::Mac.z / File::Spec::Mac
Encoding:
Text File  |  2002-10-03  |  5.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4. FFFFiiiilllleeee::::::::SSSSppppeeeecccc::::::::MMMMaaaacccc((((3333))))                                          FFFFiiiilllleeee::::::::SSSSppppeeeecccc::::::::MMMMaaaacccc((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      File::Spec::Mac - File::Spec for MacOS
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      require File::Spec::Mac;
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      Methods for manipulating file specifications.
  16.  
  17. MMMMEEEETTTTHHHHOOOODDDDSSSS
  18.      canonpath
  19.        On MacOS, there's nothing to be done.  Returns what it's given.
  20.  
  21.      catdir
  22.        Concatenate two or more directory names to form a complete path ending
  23.        with a directory.  Put a trailing : on the end of the complete path if
  24.        there isn't one, because that's what's done in MacPerl's environment.
  25.  
  26.        The fundamental requirement of this routine is that
  27.  
  28.                  File::Spec->catdir(split(":",$path)) eq $path
  29.  
  30.        But because of the nature of Macintosh paths, some additional
  31.        possibilities are allowed to make using this routine give resonable
  32.        results for some common situations.  Here are the rules that are used.
  33.        Each argument has its trailing ":" removed.  Each argument, except the
  34.        first, has its leading ":" removed.  They are then joined together by a
  35.        ":".
  36.  
  37.        So
  38.  
  39.                  File::Spec->catdir("a","b") = "a:b:"
  40.                  File::Spec->catdir("a:",":b") = "a:b:"
  41.                  File::Spec->catdir("a:","b") = "a:b:"
  42.                  File::Spec->catdir("a",":b") = "a:b"
  43.                  File::Spec->catdir("a","","b") = "a::b"
  44.  
  45.        etc.
  46.  
  47.        To get a relative path (one beginning with :), begin the first argument
  48.        with :  or put a "" as the first argument.
  49.  
  50.        If you don't want to worry about these rules, never allow a ":" on the
  51.        ends of any of the arguments except at the beginning of the first.
  52.  
  53.        Under MacPerl, there is an additional ambiguity.  Does the user intend
  54.        that
  55.  
  56.                  File::Spec->catfile("LWP","Protocol","http.pm")
  57.  
  58.        be relative or absolute?  There's no way of telling except by checking
  59.        for the existance of LWP: or :LWP, and even there he may mean a
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FFFFiiiilllleeee::::::::SSSSppppeeeecccc::::::::MMMMaaaacccc((((3333))))                                          FFFFiiiilllleeee::::::::SSSSppppeeeecccc::::::::MMMMaaaacccc((((3333))))
  71.  
  72.  
  73.  
  74.        dismounted volume or a relative path in a different directory (like in
  75.        @INC).   So those checks aren't done here. This routine will treat this
  76.        as absolute.
  77.  
  78.      catfile
  79.        Concatenate one or more directory names and a filename to form a
  80.        complete path ending with a filename.  Since this uses catdir, the same
  81.        caveats apply.  Note that the leading : is removed from the filename,
  82.        so that
  83.  
  84.                  File::Spec->catfile($ENV{HOME},"file");
  85.  
  86.        and
  87.  
  88.                  File::Spec->catfile($ENV{HOME},":file");
  89.  
  90.        give the same answer, as one might expect.
  91.  
  92.      curdir
  93.        Returns a string representing of the current directory.
  94.  
  95.      rootdir
  96.        Returns a string representing the root directory.  Under MacPerl,
  97.        returns the name of the startup volume, since that's the closest in
  98.        concept, although other volumes aren't rooted there.  On any other
  99.        platform returns '', since there's no common way to indicate "root
  100.        directory" across all Macs.
  101.  
  102.      updir
  103.        Returns a string representing the parent directory.
  104.  
  105.      file_name_is_absolute
  106.        Takes as argument a path and returns true, if it is an absolute path.
  107.        In the case where a name can be either relative or absolute (for
  108.        example, a folder named "HD" in the current working directory on a
  109.        drive named "HD"), relative wins.  Use ":" in the appropriate place in
  110.        the path if you want to distinguish unambiguously.
  111.  
  112.      path
  113.        Returns the null list for the MacPerl application, since the concept is
  114.        usually meaningless under MacOS. But if you're using the MacPerl tool
  115.        under MPW, it gives back $ENV{Commands} suitably split, as is done in
  116.        :lib:ExtUtils:MM_Mac.pm.
  117.  
  118. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  119.      the _F_i_l_e::_S_p_e_c manpage
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. FFFFiiiilllleeee::::::::SSSSppppeeeecccc::::::::MMMMaaaacccc((((3333))))                                          FFFFiiiilllleeee::::::::SSSSppppeeeecccc::::::::MMMMaaaacccc((((3333))))
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                                                                         PPPPaaaaggggeeee 3333
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.